/**
 * 
 */
package com.vote.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.vote.dao.RespondentDao;
import com.vote.entity.Respondent;

//Spring Bean的标识.
@Service
// 默认将类中的所有函数纳入事务管理.
@Transactional
public class RespondentManager{	
	private static Logger log = LoggerFactory.getLogger(RespondentManager.class);
	
	@Autowired
	private RespondentDao respondentDao;
	
	public Boolean saveResp(Respondent resp){
		return respondentDao.saveResp(resp);
	}
	
	public Respondent findRespondentByIpOrCookie(String ip,String cookie){
		return respondentDao.findRespondentByIpOrCookie(ip, cookie);
	}	
}
